<template>
	<view class="box">
			<view class="detail_item"> <text>sku_id:</text>  {{ result[0].sku_id }} </view>
			<view class="detail_item"> <text> properties_name: </text> {{ result[0].properties_name }} </view>
			<view class="detail_item"> <text>price:</text> {{ result[0].price }} </view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				resList: [],
				result: []
			};
		},
		async onLoad(e) {
			console.log(e);
			await uni.request({
				url: 'http://localhost:3000/json_data',
				success: (res) => {
					this.resList = res.data.data
					for (let i = 0; i < this.resList.length; i++) {					
						if (this.resList[i].sku_id == e.goods_id) {
							console.log(this.resList[i]);
							this.result.push(this.resList[i])
							return;
						} 
					}
				},
				fail: (err) => {
					console.log(err);
				}
			})
		}
	}
</script>

<style lang="scss">
	.box{
		.detail_item{
			display: flex;
			justify-content: space-between;
			padding: 10px;
			border: 1px solid #efefef;
		}
		
	}

</style>